
#import <QuartzCore/QuartzCore.h>
#import "ResultCell.h"

@implementation ResultCell

- (void)initCell
{
    [self setSelectionStyle:UITableViewCellSelectionStyleNone];
    UIImage* buttonImage = [[UIImage imageNamed:@"btn-resultat-andra-off"] stretchableImageWithLeftCapWidth:14.0 topCapHeight:0.0];
    UIImage* buttonHighlightImage = [[UIImage imageNamed:@"btn-resultat-andra-on"] stretchableImageWithLeftCapWidth:14.0 topCapHeight:0.0];
    
    self.changeButton.titleLabel.font = [UIFont fontWithName:@"HelveticaNeue-Bold" size:13.0];
    self.changeButton.titleLabel.textColor = [UIColor whiteColor];
    self.changeButton.titleLabel.layer.shadowColor = [UIColor blackColor].CGColor;
    self.changeButton.titleLabel.layer.shadowOpacity = 0.1;
    self.changeButton.titleLabel.layer.shadowRadius = 0;
    self.changeButton.titleLabel.layer.shadowOffset = CGSizeMake(0.0f, -0.9f);
    
    [self.changeButton setBackgroundImage:buttonImage forState:UIControlStateNormal];
    [self.changeButton setBackgroundImage:buttonHighlightImage forState:UIControlStateHighlighted];
    [self.changeButton setBackgroundImage:buttonHighlightImage forState:UIControlStateSelected];
    
    [self.changeButton addTarget:self action:@selector(changeButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
    
    buttonImage = [[UIImage imageNamed:@"btn-resultat-raknat-off"] stretchableImageWithLeftCapWidth:14.0 topCapHeight:0.0];
    buttonHighlightImage = [[UIImage imageNamed:@"btn-resultat-raknat-on"] stretchableImageWithLeftCapWidth:14.0 topCapHeight:0.0];
    
    
    self.infoButton.titleLabel.font = [UIFont fontWithName:@"HelveticaNeue-Bold" size:13.0];
    self.infoButton.titleLabel.textColor = [UIColor whiteColor];
    self.infoButton.titleLabel.layer.shadowColor = [UIColor blackColor].CGColor;
    self.infoButton.titleLabel.layer.shadowOpacity = 0.1;
    self.infoButton.titleLabel.layer.shadowRadius = 0;
    self.infoButton.titleLabel.layer.shadowOffset = CGSizeMake(0.0f, -0.9f);
    
    [self.infoButton setBackgroundImage:buttonImage forState:UIControlStateNormal];
    [self.infoButton setBackgroundImage:buttonHighlightImage forState:UIControlStateHighlighted];
    [self.infoButton setBackgroundImage:buttonHighlightImage forState:UIControlStateSelected];
    
    [self.infoButton addTarget:self action:@selector(infoButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
}

- (void)changeButtonPressed:(id)sender
{
    [self.delegate changeLampPriceForResultCellAtIndex:self.tag];
}

- (void)infoButtonPressed:(id)sender
{
    [self.delegate showInformationForResultCell];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
}

@end
